home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000086_icon-group-sender _Mon Apr 15 09:51:34 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  751b

  1. Received: by cheltenham.cs.arizona.edu; Mon, 15 Apr 1996 12:27:30 MST
  2. Message-Id: <9604151650.AA26404@odin.ucsd.edu>
  3. To: rjhare@ed.ac.uk
  4. Cc: icon-group@cs.arizona.edu
  5. Subject: Re: random numbers... 
  6. In-Reply-To: Your message of "15 Apr 1996 09:27:09 -0000."
  7.              <9604150927.ab22893@uk.ac.ed.tattoo> 
  8. Date: Mon, 15 Apr 1996 09:51:34 -0700
  9. From: William Griswold <wgg@cs.ucsd.edu>
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11. Status: O
  12.  
  13. Boy, I really like the latter one:
  14.  
  15. x := x+?[-1,0,1]
  16.  
  17. However, you could more easily build a reusable abstraction using
  18. your first example, if it is really a range:
  19.  
  20. x := x + chooseInRange(-1, 1)
  21.  
  22. procedure chooseInRange(low, high)
  23.   return ?(abs(high-low+1)) + (low-1)
  24. end
  25.  
  26. --bill
  27.